#ifndef _CURL_SAX_H
#define _CURL_SAX_H

#include <libxml/SAX.h>

#define ATTRIBUTE_KEY(index)            index
#define ATTRIBUTE_VALUE_START(index)    index + 3
#define ATTRIBUTE_VALUE_END(index)      index + 4

struct curldata {
  void *xml_user_data;
  xmlParserCtxtPtr ctx;
  xmlSAXHandler *sax_handler;
};
typedef struct curldata CurlData;

size_t curl_sax_callback(void *, size_t, size_t, void *);
int curl_sax_get_attribute(char *, char *, size_t, int, const xmlChar **);
int curl_sax_get_data(const char *, xmlSAXHandler *, void *, int);

#endif
